import request from '@/utils/request.js'

/**
 *
 * @returns 获取楼宇详情
 */
// 获取楼宇列表
export const getBuildingListAPI = params => {
  return request({
    url: '/park/building',
    method: 'get',
    params
  })
}
// 添加楼宇
/**
 *
 * @param {*} data{
 *
 *name
string
楼宇名称
必需
floors
number
层数
必需
area
number
在管面积
必需
propertyFeePrice
number
物业费单价
必需

 * }
 * @returns
 */
export const addBuildingAPI = data => {
  return request({
    url: '/park/building',
    method: 'post',
    data
  })
}

/**
 *
 * @param {*} data{
 * id
integer
id主键
必需
name
string
楼宇名称
必需
floors
number
层数
必需
area
number
在管面积
必需
propertyFeePrice
number
物业费单价
必需
}
 * @returns
 */

// 编辑楼宇

export const editBuildingAPI = data => {
  return request({
    url: '/park/building',
    method: 'put',
    data
  })
}
/**
 *
 * @param {*} id
 * @returns
 */
// 查询楼宇详情
export const getBuildingDetailAPI = id => {
  return request({
    url: `/park/building/${id}`,
    method: 'get'
  })
}
// 删除楼宇
/**
 *
 * @param {*} id
 * @returns
 */
export const deleteBuildingAPI = id => {
  return request({
    url: `/park/building/${id}`,
    method: 'delete'
  })
}
